<?php


namespace app\api\validate;


use think\Validate;

class SystemRoleMenu extends Validate
{
    /**
     * @var string[] 验证规则
     */
    protected $rule = [
        'role_id' => 'require|number',
        'menu_ids' => 'require|array'
    ];

    /**
     * @var string[] 验证不同过的错误提示
     */
    protected $message = [
        'role_id.require' => '角色id不能为空!',
        'role_id.number' => '角色id不正确!',
        'menu_ids.require' => '菜单id不能为空!',
        'menu_ids.array' => '菜单id不正确!'
    ];

    /**
     * @var \string[][] 验证场景
     */
    protected $scene = [
        'add' => ['role_id', 'menu_ids'],
        'detail' => ['role_id']
    ];
}